import { request } from '@/utils/request';
import CRUD from '@/utils/request/CRUD';

// 产品订单CRUD
export const productOrderCRUD = CRUD('/system/product-order');

// 产品设计信息CRUD
export const productDesignInfoCRUD = CRUD('/system/product-design-info-log');

// 产品订单合同CRUD
export const productContractCRUD = CRUD('/system/product-contract');

// 更新产品进度
export function updateProductContractProgress(data: Record<string, any>) {
  return request.post({
    url: '/system/product-contract/update-progress',
    data,
  });
}
// 审核产品下单
export function productContractApproval(data: Record<string, any>) {
  return request.post({
    url: '/system/product-contract/approval-place-an-order',
    data,
  });
}

// 转派产品设计师
export function dispatchToDesigner(data: Record<string, any>) {
  return request.post({
    url: '/system/product-order/dispatch-to-designer',
    data,
  });
}

// 产品合同审批
export function approvalProductContract(data: Record<string, any>) {
  return request.post({
    url: '/system/product-contract/approval',
    data,
  });
}

// 产品延期审批
export function approvalYanqiProductContract(data: Record<string, any>) {
  return request.post({
    url: '/system/product-contract/approval-yanqi',
    data,
  });
}
// 订单id获得产品订单
export function getProductOrderbyOrderid(params: Record<string, any>) {
  return request.get({
    url: '/system/product-order/get-by-orderid',
    params,
  });
}